{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=508
  Verdict: Accepted
}
var a,b:longint;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
readln(a,b);
if (a>b*2) or (b>a*2) then write('NO SOLUTION') else begin
if (a>b) and (A>0) and (b>0) then begin
   if (a>0) and (b>0) then begin
      write('BG');
      dec(A);
      dec(b);
   end;
   while (a>b) and (a>1) and (b>0) do begin
         write('BBG');
         dec(a,2);
         dec(b);
   end;
   if (b>a) and (b>0) then write('G');
   while (a>0) and (b>0) do begin
         write('BG');
         dec(A);
         dec(b);
   end;
   if (a=1) and (b=0) then write('B');
end else
if (a>0) and (b>0) then begin
   if (a>0) and (b>0) then begin
      dec(a);
      dec(b);
      write('GB');
   end;
    while (b>a) and (b>1) and (a>0) do begin
          write('GGB');
          dec(b,2);
          dec(A);
    end;
    if (a>b) and (b>0) then write('B');
    while (b>0) and (a>0) do begin
          write('GB');
          dec(b);
          dec(A);
    end;
    if (b=1) and (a=0) then write('G');
end;
end;
end.